
const http = require("http");

const app = http.createServer((req,res) => {

    let resData = {},
        postData = [];

    req.on('data',chunk => {
        postData.push(chunk);
    })

    req.on('end',() => {
        resData.postData = Buffer.concat(postData).toString();
        res.end(JSON.stringify(resData));
    })
});


app.listen(3000,() => {
    console.log('应用已启动');
})